﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.Runtime.InteropServices;

namespace QLNhanKhau
{
    public partial class frmBaoCaoSHK : Form
    {
        public frmBaoCaoSHK()
        {
            InitializeComponent();
        }

        private void btnPrint_Click(object sender, EventArgs e)
        {
            Report rep = new Report((DateTime)dateBatDau.Value, (DateTime)dateKetThuc.Value,true);
            //rep.Show();
            rep.Print();
           
            //StringBuilder dp = new StringBuilder(256);
            //int size = dp.Capacity;
            //if (GetDefaultPrinter(dp, ref size))
            //{
            //    Report rep = new Report();
            //    rep.PrintByPrinter(dp.ToString().Trim());
            //}
        }
        [DllImport("winspool.drv", CharSet = CharSet.Auto, SetLastError = true)]
        public static extern bool GetDefaultPrinter(StringBuilder pszBuffer, ref int size);
        public DateTime batdau;
        public DateTime ketthuc;

        private void frmBaoCaoSHK_Load(object sender, EventArgs e)
        {

        }
    }
}
